Skip to content

Feature/13 scarp reasons codes#53

Merged
jakub-przepiora merged 7 commits into
developfrom
feature/13-scarp-reasons-codes
Jun 8, 2026
Merged

Feature/13 scarp reasons codes#53
jakub-przepiora merged 7 commits into
developfrom
feature/13-scarp-reasons-codes

Conversation

@JanKolo04

Copy link
Copy Markdown
Collaborator

Summary

Adds scrap reason codes: predefined, categorized (5M - material / machine / method / man / environment) defect reasons that operators
select when reporting scrap against a work order. Gives a per-work-order quality metric and a Pareto view of which reasons cause the most
scrap, so the team can prioritise the vital-few defect causes. Built on the current React/Inertia + Electric stack (admin CRUD + reports as
React pages, operator reporting on the work order detail).

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • Other:

Related issue

Closes #13

Testing

Verified end to end against the running app (admin CRUD + reports, operator scrap reporting), plus an automated scrap suite. Covers reason
CRUD, operator entry creation, report data, per-work-order quality, and per-tenant isolation.

  • Tested manually in browser
  • php artisan test passes - scrap suite green (30/30); the ~12 unrelated pre-existing failures (CsvImport, modules, PIN login,
    onboarding) predate this branch, confirmed via git stash. Run with php -d memory_limit=2G vendor/bin/phpunit (suite exceeds 128M in one
    process).
  • Tested as Operator / Supervisor / Admin role (if UI change)

Checklist

  • No .env secrets committed
  • Migration added if schema changed
  • $fillable updated if new model columns added
  • No raw SQL with user input (use Eloquent / Query Builder)
  • CSRF protection in place for any new forms
  • composer audit clean - reports pre-existing transitive advisories (e.g. symfony/routing CVE-2026-45065); not introduced by this PR

@JanKolo04 JanKolo04 requested a review from jakub-przepiora June 2, 2026 22:54
Comment thread backend/database/seeders/ScrapReasonsSeeder.php
JanKolo04 and others added 5 commits June 8, 2026 08:57
…/TR keys

Index/Create/Edit and fields.js now translate all labels via the __()
helper instead of rendering hard-coded English. fields.js exports
factory functions (scrapReasonFields/scrapCategoryOptions) so labels are
resolved at render time, after the locale chunk loads at bootstrap.

Adds the 4 keys these screens reference that were missing from the lang
files (+ New Reason, No scrap reasons yet., Used, Delete scrap reason
":name"?) to pl.json (Polish), en.json (identity) and tr.json (Turkish).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Brings develop (Work Order History, process photos, lot patterns, realtime
refactor, etc.) into the scrap-reasons i18n branch.

Conflict resolutions:
- lang/pl.json, lang/en.json: union of both key sets (develop wins on shared
  keys; "Report" -> develop's "Raport"). Our 4 new scrap keys kept.
- adminNav.js: dropped duplicate Reports from the Admin group (develop moved it
  to a dedicated Reports group) and moved our "Scrap Reports" entry into that
  Reports group alongside "Work Order History".
- CHANGELOG.md: kept both Added blocks + develop's Changed note.
- Operator/WorkOrderController.php: keep develop's processPhotos block; render
  both scrapReasons and processPhotos.
- operator/WorkOrderDetail.jsx: destructure both scrapReasons and processPhotos.

Verified: pl/en/tr JSON valid, PHP lints clean, vite build succeeds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…/13-scarp-reasons-codes

Brings develop's inspection-plan version/publish lifecycle (#62). No scrap
files touched by the incoming commits.

Conflict resolutions:
- lang/pl.json, lang/en.json: union of both key sets (no value conflicts);
  our scrap keys kept, develop's inspection keys added.
- routes/web.php: kept our scrap-reports route AND develop's new
  inspection-plans publish route.

Verified: pl/en/tr JSON valid, php -l routes/web.php clean, vite build succeeds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…on UI) into feature/13-scarp-reasons-codes

Resolves the PR's pl.json/en.json conflicts. No scrap files touched by the
incoming commits; adminNav.js auto-merged (our Reports group + Scrap Reasons kept).

Conflict resolutions:
- lang/pl.json, lang/en.json: union of both key sets. NOTE: develop's blobs were
  malformed JSON (missing comma after "Version history" before "CLOSED"); repaired
  during merge so the files parse. Develop wins on shared keys ("Used" -> "Użyte").
  Our scrap keys preserved. 3145 keys each.

Verified: pl/en/tr JSON valid, vite build succeeds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jakub-przepiora jakub-przepiora merged commit a915b72 into develop Jun 8, 2026
luizinhoh2o1 pushed a commit to luizinhoh2o1/OpenMes that referenced this pull request Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants